{__NOLAYOUT__}
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport"
		  content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
	<title>评价</title>
	{include file="public/script" /}
	<link rel="stylesheet" type="text/css" href="__STATIC__/www/css/font-awesome.min.css"/>
</head>
<body>
	<div class="sectionH  sectionH2 mui-clearfix">
		<header class="mui-bar mui-bar-nav" style="">
			<a class="mui-icon mui-icon-left-nav  mui-pull-left" href="javascript:history.back(-1)" style="color: #727272;"></a>
			<h1 class="mui-title">评价</h1>
			<!--<a class="mui-icon mui-pull-right right1" href="assets-1.html"><img src="images/icon_setting.png"/></a>-->
		</header>
	</div>
	<div class="kong1"></div>
	<div class="set_yijian_section1">
		<div class="container">
			<form action="" method="post">
				<div class="f4 mui-clearfix">
					<textarea id="content" rows="8" cols="" placeholder="您有什么想说的，就在这里倾诉吧~"></textarea>
				</div>
				<div class="fp">
					<p class="p1">
						<span class="fa fa-star select"></span>
						<span class="fa fa-star select"></span>
						<span class="fa fa-star select"></span>
						<span class="fa fa-star select"></span>
						<span class="fa fa-star select"></span>
					</p>
				</div>
				<div class="sub">
					<input type="button" style="color:#fff;" value="提交"/>
				</div>
			</form>
		</div>
		
	</div>
	
</body>
<script>
	$(function(){
		$(".fp .p1 span").click(function(){
            $(".fp .p1 span").removeClass('select');
            $(this).addClass('select');
            $(this).prevAll().addClass('select');
		});
        $('.sub').click(function () {
            if($('#content').val()==''){mui.alert('请输入评语！');return false;}
            if($('.sub').hasClass('sending')){
                mui.toast('评价提交中...');
                return false;
            }
            var content=$('#content').val();
            var star = 0;
            $(".fp .p1 span").each(function(){
                if($(this).hasClass('select')){
                    ++star;
				}
			});
            var id = "{$id}";
            $.ajax({
                type:'post',
                url:"{:url('User/ordercomm')}",
                data:{star:star,content:content,id:id},
                cache:false,
                dataType:'JSON',
                success:function(data){
                    if(data.result_code==='0000'){
                        mui.alert('评价提交成功','',function(){
                            window.history.back();
                        });
                    }else if(data.result_code==='1111'){
                        mui.alert('请登录','',function(){
                            window.location.href='/Login/login';
                        });
                    }else{
                        mui.alert(data.result_info);
                        $(".sub").removeClass('sending');
                    }

                },
                error:function(e){
                    $(".sub").removeClass('sending');
                },
                beforeSend:function(e){
                    $(".sub").addClass('sending');
                }
            });
        });
	})
</script>



</html>